package com.teacher;

import java.util.Scanner;

public class UserPassword {
    String userName;
    String userPwd;
    //admin 123456
    public void updUserPwd(){
        System.out.println("请输入用户名:");
        Scanner input = new Scanner(System.in);
        userName = input.next();
        System.out.println("请输入密码:");
        userPwd = input.next();
        if("admin".equals(userName)&&"123456".equals(userPwd)){
                System.out.println("请输入新密码:");
                userPwd= input.next();
            System.out.println("密码修改成功!"+userPwd);
        }else {
            System.out.println("密码错误!");
        }
    }
}
